package cn.js.ccit.service.impl;

import cn.js.ccit.entity.Department;
import cn.js.ccit.mapper.DepartmentMapper;
import cn.js.ccit.service.DepartmentService;
import cn.js.ccit.utils.MyBatisUtils;
import cn.js.ccit.vo.DepartmentVo;

import java.util.List;

public class DepartmentServiceImpl implements DepartmentService {
    DepartmentMapper departmentMapper =  MyBatisUtils.getSession().getMapper(DepartmentMapper.class);
    @Override
    public List<DepartmentVo> getDepartmentBy(Department department) {
        return departmentMapper.getDepartmentBy(department);
    }

    @Override
    public DepartmentVo getDepartmentById(Integer departId) {
        return departmentMapper.getDepartmentById(departId);
    }

    @Override
    public List<DepartmentVo> getAllDepartment() {
        return departmentMapper.getAllDepartment();
    }

    @Override
    public boolean addDepartment(Department department) {
        return departmentMapper.addDepartmentBy(department);
    }

    @Override
    public boolean deleteDepartmentById(Integer departId) {
        return departmentMapper.deleteDepartmentById(departId);
    }
}
